#
# $Id: Makefile 28 2009-04-26 13:30:06Z doug.hellmann $
#

PROJECT=svnbackup
SVNHOME=$(shell svn info | grep "^URL" | sed 's/^URL: //')
VERSION=$(shell basename $(shell pwd))
RELEASE=$(PROJECT)-$(VERSION)

info:
	SVNHOME=$(SVNHOME)
	PROJECT=$(PROJECT)
	VERSION=$(VERSION)
	RELEASE=$(RELEASE)

package: dist export
	(rm -f dist/$(RELEASE).zip)
	(cd dist/; tar zcvf $(RELEASE).tar.gz $(RELEASE))
	mv dist/$(RELEASE).tar.gz ~/Desktop/

dist:
	mkdir -p dist

# Dump a version that does not include .svn directories.
export:
	rm -rf dist/$(RELEASE)
	(cd dist; svn export $(SVNHOME) $(RELEASE); rm -f $(RELEASE)/Makefile)

# Run the tests
.PHONEY: tests
tests:
	sh $(PWD)/test/test.sh
